package com.lewis.mapper;

import java.util.List;
import java.util.Set;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.lewis.entry.User;
import com.lewis.vo.PemsVo;

@Repository
public interface UserMapper {
	
	/**
	 * add user
	 * @param user
	 */
	public void addUser(@Param("user") User user) throws Exception;
    
	/**
	 * set role for user
	 * @param username
	 * @param string
	 */
	public void setRole(@Param("user") User user) throws Exception;
	
	
	/**
	 * 
	 * Dynamic SQL test <where>,<if>
	 * @return
	 * @throws Exception
	 */
	public List<User> getUser(@Param("username")String username) throws Exception;
	
	
	/**
	 * test <set>,<if>
	 * @param user
	 * @throws Exception
	 */
	public void updateUser(@Param("user")User user) throws Exception;
	
	
	/**
	 * get permissions
	 * @param username
	 * @return
	 * @throws Exception
	 */
	public PemsVo getPermis(@Param("username")String username) throws Exception;
    
	/**
	 * delete user
	 * @param username
	 */
	public void deleteUser(@Param("username")String username);
		
	/**
	 * delete the permission of the user
	 * @param username
	 */
	public void deleteUserRole(@Param("username")String username);
	
}
